﻿using Handday.Erp.Transfer.Models.EightTradingSource;
using HandDay.Framework.Common.Services;
using HandDay.Framework.Core.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Handday.Erp.Transfer.Services
{
    /// <summary>
    /// 8项交易数据服务
    /// </summary>
    public interface IEightTradingService : ITransientDependency
    {
        /// <summary>
        /// 接收ERP数据
        /// </summary>
        Task<ServiceResult> ReceiveAsync(List<EightTradingSourceAddDto> list);

        /// <summary>
        /// 获取最大记账日期
        /// </summary>
        /// <param name="corpId">企业编号</param>
        Task<ServiceResult<EightTradingAccountTimeDto>> GetMaxAccountTimeAsync(ulong corpId);

        /// <summary>
        /// 清除数据
        /// </summary>
        /// <param name="time">清除日期</param>
        Task<ServiceResult> ClearAsync(DateTimeOffset? time);

        /// <summary>
        /// 初始化表
        /// </summary>
        /// <param name="corpId">企业编号</param>
        Task<ServiceResult> InitTableAsync(ulong corpId);

        /// <summary>
        /// 源数据列表请求
        /// </summary>
        Task<List<EightTradingSourceDto>> PageListAsync(EightTradingSourceRequestDto request);
    }
}
